
import Fingerprint2 from 'fingerprintjs2'

export const fingerprint = {
    get: callback => {
        Fingerprint2.get({
            excludes: {
                audio: true,
                fontsFlash: true,
                webgl: true,
                canvas: true,
                enumerateDevices: true
            }
        }, components => {
            let values = components.map(component => {
                return component.value
            });
            let uuid = Fingerprint2.x64hash128(values.join(''), 31)
            callback && callback(uuid)
        });
    }
}